package com.example.demo.commons.jpa;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.NoRepositoryBean;

import java.io.Serializable;

/**
 * @ClassName: JpaRepositoryEnhance
 * @Description:  JPA增强接口(扩展批量增加,批量更新方法)
 * @Author: sk
 * @Date: 2020/4/13 15:44
 * @Version: 1.0.0
 * @Remark:
 **/
@NoRepositoryBean
public interface JpaRepositoryEnhance<T,ID extends Serializable> extends JpaRepository<T,ID> {

    <S extends T> Iterable<S> batchSave(Iterable<S> entities);
    <S extends T> Iterable<S> batchUpdate(Iterable<S> entities);
}